# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        博智科技  
# Name:         demo06243
# Description:
# Author:       yzl
# Date:         2019-03-02
#-------------------------------------------------------------------------------
list1 = [11,22,33]
list2 =['aa','bb','cc','dd']
length = len(list1)
# for i in range(length):
#     print(list1[i],list2[i])

# list3 = [1,2,3,4,5]
# for v in zip(list1,list2,list3):
#     print(v)

# for v in d.values():
#     print(v)
#
# print(d.keys())
#
# if 'name' in d.keys():
#     print('ok')


# 浅拷贝与深拷贝
d = {'name':'Yzl','work':'软件开发者','salary':10000,'info':['address','java']}

d1 = d.copy()
# print(d1)
d['name'] = 'copy'
d1['name'] = 'd1d1'
print('d',d)
print('d1',d1)
print('copy-------------->第二层')
d['info'][0] = '工业大学'
d1['info'][0] = '职教城'
print('d',d)
print('d1',d1)

print()
print('------------------------')
from copy import deepcopy
d2 = deepcopy(d)
d['name'] = 'deepcopy'
d2['name'] = 'd2d2'
print('d',d)
print('d2',d2)

print('deepcopy-------------->第二层')
d['info'][0] = '工业大学'
d2['info'][0] = '职教城'
print('d',d)
print('d2',d2)

# 随机抛出
print('popitem---------->')
dd = {'name':'Yzl','work':'软件开发者','salary':10000}
print(dd.popitem())
print(dd)
print()
print('pop---------->')
print(dd.pop('name'))
print(dd)

# get 的区别
print('get---------->')
print(dd.get('name','xxx'))
print(dd['name'])






